﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:UIControls="clr-namespace:DiagramCreator"
	mc:Ignorable="d"
	x:Class="DiagramCreator.SplitButton"
	x:Name="UserControl"
	d:DesignWidth="640" d:DesignHeight="480" Height="33" Width="Auto">
	<UserControl.Resources>
		<Style x:Key="SplitButtonLeft" BasedOn="{x:Null}" TargetType="{x:Type Button}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
						<Grid Background="{x:Null}">
							<Rectangle Margin="0,0,0,0" Fill="{DynamicResource NormalBackgroundBrush}" Stroke="{DynamicResource InactiveBorderBrush}" StrokeThickness="1" RadiusX="4" RadiusY="4" x:Name="rectangle"/>
							<Rectangle HorizontalAlignment="Left" Margin="0,1,0,1" Width="7" Fill="{DynamicResource NormalBackgroundBrush}" Stroke="{DynamicResource InactiveBorderBrush}" StrokeThickness="0" RadiusX="0" RadiusY="0" x:Name="rectangle1"/>
							<Border HorizontalAlignment="Left" Margin="0,0,0,0" Width="4" BorderBrush="{DynamicResource InactiveBorderBrush}" BorderThickness="0,1,0,1" x:Name="border"/>
							<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" RecognizesAccessKey="True"/>
						</Grid>
						<ControlTemplate.Triggers>
							<Trigger Property="IsFocused" Value="True"/>
							<Trigger Property="IsDefaulted" Value="True"/>
							<Trigger Property="IsMouseOver" Value="True">
								<Setter Property="Fill" TargetName="rectangle" Value="{DynamicResource HighlightBackgroundBrush}"/>
								<Setter Property="Fill" TargetName="rectangle1" Value="{DynamicResource HighlightBackgroundBrush}"/>
								<Setter Property="Stroke" TargetName="rectangle" Value="{DynamicResource BorderBrush}"/>
								<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource BorderBrush}"/>
								<Setter Property="BorderThickness" TargetName="border" Value="1,1,0,1"/>
							</Trigger>
							<Trigger Property="IsPressed" Value="True">
								<Setter Property="Fill" TargetName="rectangle1" Value="{DynamicResource PressedBackgroundBrush}"/>
								<Setter Property="Fill" TargetName="rectangle" Value="{DynamicResource PressedBackgroundBrush}"/>
								<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource BorderBrush}"/>
								<Setter Property="Stroke" TargetName="rectangle1" Value="{DynamicResource BorderBrush}"/>
								<Setter Property="Stroke" TargetName="rectangle" Value="{DynamicResource BorderBrush}"/>
								<Setter Property="BorderThickness" TargetName="border" Value="1,1,0,1"/>
								<Setter Property="Width" TargetName="border" Value="6"/>
								<Setter Property="Margin" TargetName="border" Value="0,0,0,0"/>
							</Trigger>
							<Trigger Property="IsEnabled" Value="False"/>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</UserControl.Resources>
	<Grid Name="RootLayout">
		<Button Style="{DynamicResource SplitButtonRight}" Width="Auto" Height="Auto" Margin="0,0,15,0" Grid.ColumnSpan="2" x:Name="MainButton" FontFamily="Verdana" FontSize="12">
			Zapisz
		</Button>
		<Button HorizontalAlignment="Right" Style="{DynamicResource SplitButtonLeft}" Width="15" Grid.Column="1" x:Name="DropDownButton">
			<Label HorizontalAlignment="Left" Margin="0,0,0,0" Width="26.001" Content="" FontFamily="Webdings" FontWeight="Bold" FontStyle="Normal" FontSize="12" d:IsStaticText="True" Padding="0,0,0,0" FontStretch="UltraExpanded"/>	
		</Button>
		<Popup Margin="0,0,0,0" Grid.Column="1" IsOpen="False" StaysOpen="False" Placement="Bottom" Width="{Binding Path=ActualWidth, ElementName=UserControl, Mode=Default}" Height="Auto" x:Name="DropDownButtons" AllowsTransparency="True">
			<Border BorderBrush="{DynamicResource GroupBoxHighlightForegroundBrush}" BorderThickness="0,0,0,0" Width="Auto" Height="Auto">				
				<StackPanel Background="{DynamicResource TabItemBackgroundBrush}" Width="Auto" Height="Auto" x:Name="DropDownButtonsStackPanel">
				
				</StackPanel>
			</Border>
		</Popup>		
	</Grid>
</UserControl>